﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!HttpContext.Current.User.Identity.IsAuthenticated)
        {
            WelcomeLabel.Text = "<span><a href=\"logon.aspx\">登录</a> <a href=\"register.aspx\">注册</a> <a class=\"last\" href=\"HowToSet139.aspx\">帮助</a> </span>";
        }
        else
        {
            WelcomeLabel.Text = "<span><a href=\"UserPanel.aspx\">" + HttpContext.Current.User.Identity.Name + "</a> <a href=\"logoff.aspx\">退出</a> <a class=\"last\" href=\"HowToSet139.aspx\">帮助</a> </span>";
        }
    }

    public bool IsNumber(string s)
    {
        if (string.IsNullOrEmpty(s))
        {
            return false;
        }
        char[] sA = s.ToCharArray();
        foreach (char c in sA)
        {
            if (c > '9' || c < '0')
            {
                return false;
            }
        }
        return true;
    }

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        FormsAuthentication.SignOut();
        FormsAuthentication.RedirectToLoginPage();
    }
}
